import request from "@/utils/request";

// 查询发票列表
export function listInvoice(query) {
  return request({
    url: "/logex/invoice/list",
    method: "get",
    params: query,
  });
}

// 查询发票详细
export function getInvoice(id) {
  return request({
    url: "/logex/invoice/" + id,
    method: "get",
  });
}

// 新增发票
export function addInvoice(data) {
  return request({
    url: "/logex/invoice",
    method: "post",
    data: data,
  });
}

// 修改发票
export function updateInvoice(data) {
  return request({
    url: "/logex/invoice",
    method: "put",
    data: data,
  });
}

// 删除发票
export function delInvoice(id) {
  return request({
    url: "/logex/invoice/" + id,
    method: "delete",
  });
}

export function makeInvoice(data) {
  data.version = 2;
  return request({
    url: "/logex/invoice/makeInvoice",
    method: "post",
    data: data,
  });
}
